package socket;

import com.google.common.collect.Lists;

import java.net.ServerSocket;
import java.net.Socket;
import java.util.List;

/**
 * User: heihaier@xfuweng.com
 * Date: 2015/7/8
 * Time: 14:41
 */
public class MyServer {

    public static List<Socket> list = Lists.newArrayList();

    public static void main(String[] args) throws Exception {

        ServerSocket server = new ServerSocket(1111);
        while (true) {

            Socket socket = server.accept();
            list.add(socket);
            new Thread(new ServerThread(socket)).start();
        }
    }
}
